<template>
  <div>
    <el-row>
      <el-col :span="24" id="VenueManagement1" >
        <div style="text-align: left;">场馆名：<el-input @change="loadAllVenue()" v-model="venueNameChos" style="width: 30%;" placeholder="请输入场馆名称" ></el-input>
        </div>
        <div style="height: 20px;"></div>
        <el-table :data="page.records" border>

          <el-table-column prop="venueId" label="场馆ID" width="65">
          </el-table-column>

          <el-table-column  prop="venueName" label="场馆名" width="110">
          </el-table-column>
          <el-table-column prop="venuePhone" label="手机" width="120">
          </el-table-column>
          <el-table-column prop="venueDetail" label="详细介绍" width="170">
          </el-table-column>
          <el-table-column prop="venueState" label="账号状态" width="90">
            <template  slot-scope="scope">
              <template v-if="scope.row.venueState == 0">
                已注销
              </template>
              <template v-if="scope.row.venueState == 1">
                未认证
              </template>
              <template v-if="scope.row.venueState == 2">
                已认证
              </template>
              <template v-else>
                认证失败
              </template>
            </template>
          </el-table-column>
          <el-table-column prop="userRemark" label="备注" width="250">
          </el-table-column>



        </el-table>

        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :current-page="page.pageNum" :page-sizes="[1, 2, 3, 5]" :page-size="page.pageSize"
          layout="total, sizes, prev, pager, next, jumper" :total="page.total">
        </el-pagination>

      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    name: "VenueManagement",
    data() {
      return {
        page: {},
        param: {
          pageNum: 1,
          pageSize: 5,
        },
        venueNameChos:"",

      }
    },
    methods: {
      handleSizeChange(val) {
        this.param.pageSize = val;
        this.loadAllVenue();
      },
      handleCurrentChange(val) {
        this.param.pageNum = val;
        this.loadAllVenue();
      },
      loadAllVenue() {
        this.$http.get("/account/yVenue/pageAllVenue", {
          params: {
            pageNum: this.param.pageNum,
            pageSize: this.param.pageSize
          }
        }).then(resp => {
          this.page = resp.data.data;
        })
      }
    },
    created() {
      this.loadAllVenue();
    }
  }
</script>

<style>
  #VenueManagement2 {
    margin-left: -520px;
    line-height: 100%;
    width: 100%
  }

  #VenueManagement1 {
    line-height: 100%;
    width: 100%
  }
</style>
